﻿
Imports System.IO
Imports std
Imports xmlctrl

Public Class xhtmlControl_1_1_shared
    Inherits xmlcontrol

    Public Sub New(Optional ByVal buff As Stream = Nothing, Optional ByVal tag As String = Nothing)
        MyBase.New(buff, tag)
    End Sub

    Protected Overridable Function availableAttribute(ByVal key As String) As Boolean
        Return False
    End Function

    Public Enum xml_space_enum
        preserve
        [default]
    End Enum

    Public Overridable Property xml_space() As xml_space_enum
        Get
            If strsame(attribute("xml:space"), "preserve", False) Then
                Return xml_space_enum.preserve
            Else
                Return xml_space_enum.default
            End If
        End Get
        Set(ByVal value As xml_space_enum)
            If value = xml_space_enum.preserve Then
                attribute("xml:space") = "preserve"
            Else
                attribute("xml:space") = "default"
            End If
        End Set
    End Property

    Public Overridable Property id() As String
        Get
            Return attribute("id")
        End Get
        Set(ByVal value As String)
            attribute("id") = value
        End Set
    End Property

    Public Overridable Property [class]() As String
        Get
            Return attribute("class")
        End Get
        Set(ByVal value As String)
            attribute("class") = value
        End Set
    End Property

    Public Overridable Property title() As String
        Get
            Return attribute("title")
        End Get
        Set(ByVal value As String)
            attribute("title") = value
        End Set
    End Property

    Public Enum dir_enum
        rtl
        ltr
    End Enum

    Public Overridable Property dir() As dir_enum
        Get
            If strsame(attribute("dir"), "rtl", False) Then
                Return dir_enum.rtl
            Else
                Return dir_enum.ltr
            End If
        End Get
        Set(ByVal value As dir_enum)
            If value = dir_enum.rtl Then
                attribute("dir") = "rtl"
            Else
                attribute("dir") = "ltr"
            End If
        End Set
    End Property

    Public Overridable Property xml_lang() As String
        Get
            Return attribute("xml:lang")
        End Get
        Set(ByVal value As String)
            attribute("xml:lang") = value
        End Set
    End Property

    Public Overridable Property onclick() As String
        Get
            Return attribute("onclick")
        End Get
        Set(ByVal value As String)
            attribute("onclick") = value
        End Set
    End Property

    Public Overridable Property ondblclick() As String
        Get
            Return attribute("ondblclick")
        End Get
        Set(ByVal value As String)
            attribute("ondblclick") = value
        End Set
    End Property

    Public Overridable Property onmousedown() As String
        Get
            Return attribute("onmousedown")
        End Get
        Set(ByVal value As String)
            attribute("onmousedown") = value
        End Set
    End Property

    Public Overridable Property onmouseup() As String
        Get
            Return attribute("onmouseup")
        End Get
        Set(ByVal value As String)
            attribute("onmouseup") = value
        End Set
    End Property

    Public Overridable Property onmouseover() As String
        Get
            Return attribute("onmouseover")
        End Get
        Set(ByVal value As String)
            attribute("onmouseover") = value
        End Set
    End Property

    Public Overridable Property onmousemove() As String
        Get
            Return attribute("onmousemove")
        End Get
        Set(ByVal value As String)
            attribute("onmousemove") = value
        End Set
    End Property

    Public Overridable Property onmouseout() As String
        Get
            Return attribute("onmouseout")
        End Get
        Set(ByVal value As String)
            attribute("onmouseout") = value
        End Set
    End Property

    Public Overridable Property onkeypress() As String
        Get
            Return attribute("onkeypress")
        End Get
        Set(ByVal value As String)
            attribute("onkeypress") = value
        End Set
    End Property

    Public Overridable Property onkeydown() As String
        Get
            Return attribute("onkeydown")
        End Get
        Set(ByVal value As String)
            attribute("onkeydown") = value
        End Set
    End Property

    Public Overridable Property onkeyup() As String
        Get
            Return attribute("onkeyup")
        End Get
        Set(ByVal value As String)
            attribute("onkeyup") = value
        End Set
    End Property

End Class
